#ifndef _TW2864_LINUX
#define _TW2864_LINUX

//video_mode
#define AUTOMATICALLY 0
#define NTSC 1
#define PAL 2

typedef struct hitw2864_w_reg
{
    unsigned int addr;
    unsigned int value;
}tw2864_w_reg;

typedef struct hitw2864_set_2d1
{
    unsigned int ch1;
    unsigned int ch2;
}tw2864_set_2d1;

typedef struct hitw2864_set_videomode
{
   unsigned int ch;
   unsigned int mode;
}tw2864_set_videomode;
typedef struct hitw2864_set_controlvalue
{
   unsigned int ch;
   unsigned int controlvalue;
}tw2864_set_controlvalue;

#define TW2864_READ_REG 0x0
#define TW2864_WRITE_REG 0x1
#define TW2864_SET_ADA_PLAYBACK_SAMPLERATE  0x2
#define TW2864_SET_ADA_PLAYBACK_BITWIDTH  0x3
#define TW2864_SET_ADA_PLAYBACK_BITRATE   0x4 
#define TW2864_SET_D1   0x5
#define TW2864_SET_2_D1     0x6
#define TW2864_SET_4HALF_D1 0x7
#define TW2864_SET_4_CIF    0x8
#define TW2864_SET_AUDIO_OUTPUT    0x9
#define TW2864_SET_AUDIO_MIX_OUT     0x10
#define TW2864_SET_AUDIO_RECORD_M  0x11
#define TW2864_SET_MIX_MUTE     0x12
#define TW2864_CLEAR_MIX_MUTE   0x13
#define TW2864_SET_ADA_SAMPLERATE 0x14
#define TW2864_SET_ADA_BITWIDTH   0x15
#define TW2864_SET_ADA_BITRATE   0x16
#define TW2864_SET_VIDEO_MODE 0x17

#define TW2864_GET_ADA_PLAYBACK_SAMPLERATE  0x18
#define TW2864_GET_ADA_PLAYBACK_BITWIDTH   0x19
#define TW2864_GET_ADA_PLAYBACK_BITRATE   0x20
//#define TW2864_GET_D1   0x21
//#define TW2864_GET_2_D1     0x22
//#define TW2864_GET_4HALF_D1  0x23
//#define TW2864_GET_4_CIF    0x24
#define TW2864_GET_AUDIO_OUTPUT     0x25
//#define TW2864_GET_AUDIO_MIX_OUT     0x26
//#define TW2864_GET_AUDIO_RECORD_M   0x27
//#define TW2864_GET_MIX_MUTE     0x28
//#define TW2864_GET_MIX_MUTE_CLEAR   0x29
#define TW2864_GET_ADA_SAMPLERATE  0x30
#define TW2864_GET_ADA_BITWIDTH   0x31
#define TW2864_GET_ADA_BITRATE   0x32
#define TW2864_GET_VIDEO_MODE 0x33
#define TW2864_REG_DUMP  0x34
#define TW2864_SET_CHANNEL_SEQUENCE 0x35
#define TW2864_SET_AUDIO_CASCAD 0x36


#define TW2864_HUE_CONTROL 0x37
#define TW2864_SATURATION_CONTROL 0x38
#define TW2864_CONTRAST_CONTROL 0x39
#define TW2864_BRIGHTNESS_CONTROL 0x40
#define TW2864_LUMINANCE_PEAKING_CONTROL 0x41
#define TW2864_CTI_CONTROL 0x42

#define TW2864_GET_HUE_SET 0x43 
#define TW2864_GET_SATURATION_SET 0x44
#define TW2864_GET_CONTRAST_SET 0x45 
#define TW2864_GET_BRIGHTNESS_SET 0x46
#define TW2864_GET_LUMINANCE_PEAKING_SET 0x47
#define TW2864_GET_CTI_SET 0x48
#define TW2864_SET_PLAYBACK_MODE 0x49
#define TW2864_SET_CLOCK_OUTPUT_DELAY 0x50
#define TW2864_LOCAL_AUDIO_LOOP   0x51
#define TW2864_PLAYBACK_AUDIO_LOOP 0x52
#define TW2864_GET_VEDIO_LOST_INFORMATION 0x53
#define TW2864_AUDIO_OUTPUT_GAIN 0x54
#define TW2864_AUDIO_INPUT_GAIN 0x55


#define SET_8K_SAMPLERATE 0
#define SET_16K_SAMPLERATE 1
#define SET_8_BITWIDTH 1
#define SET_16_BITWIDTH 0
#define SET_256_BITRATE 0
#define SET_384_BITRATE 1
#define SET_AUDIO_CASCAD 0
#define SET_AUDIO_SINGLE 1
#define MASTER 1
#define SLAVER 0

typedef enum Tw2815Ret_
{
	TW2864_IOCTL_FAIL =-1,	
	TW2864_IOCTL_OK = 0,    
	TW2864_SET_D1_FAIL , 
	TW2864_SET_2_D1_FAIL ,
	TW2864_SET_4HALF_D1_FAIL ,
	TW2864_SET_4_CIF_FAIL  ,
	TW2864_SET_AUDIO_OUTPUT_FAIL ,
	TW2864_SET_ADA_SAMPLERATE_FAIL ,
	TW2864_SET_ADA_BITWIDTH_FAIL ,
	TW2864_SET_ADA_BITRATE_FAIL ,
	TW2864_SET_ADA_PLAYBACK_SAMPLERATE_FAIL ,
	TW2864_SET_ADA_PLAYBACK_BITWIDTH_FAIL ,
	TW2864_SET_ADA_PLAYBACK_BITRATE_FAIL ,
	TW2864_SET_VIDEO_MODE_FAIL ,
	TW2864_SET_CHANNEL_SEQUENCE_FAIL ,
	TW2864_SET_AUDIO_CASCAD_FAIL ,    	
	TW2864_SET_MIX_MUTE_FAIL ,    	
	TW2864_CLEAR_MIX_MUTE_FAIL ,     	
	TW2864_HUE_CONTROL_FAIL,
	TW2864_SATURATION_CONTROL_FAIL,
	TW2864_CONTRAST_CONTROL_FAIL,
	TW2864_BRIGHTNESS_CONTROL_FAIL,
	TW2864_LUMINANCE_PEAKING_FAIL,
	TW2864_CTI_CONTROL_FAIL,
	TW2864_GET_HUE_SET_FAIL,
	TW2864_GET_SATURATION_SET_FAIL,
	TW2864_GET_CONTRAST_SET_FAIL,
	TW2864_GET_BRIGHTNESS_SET_FAIL,
	TW2864_GET_LUMINANCE_PEAKING_SET_FAIL,
	TW2864_GET_CTI_SET_FAIL,
	TW2864_READ_REG_FAIL,
	TW2864_WRITE_REG_FAIL,
	TW2864_GET_VIDEO_MODE_FAIL,
	TW2864_SET_AUDIO_MIX_OUT_FAIL,
	TW2864_SET_AUDIO_RECORD_M_FAIL,
	TW2864_SET_PLAYBACK_MODE_FAIL,
	TW2864_SET_CLOCK_OUTPUT_DELAY_FAIL,
}Tw2864Ret;

#endif
